<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\modules\user\models\User */
/* @var $form yii\widgets\ActiveForm */
if ($model->token){}else{
    $model->token = Yii::$app->security->generateRandomString();
}
if ($model->sign_key){}else{
    $model->sign_key = Yii::$app->security->generateRandomString();
}
?>
<div class="user-form">
    <?php $form = ActiveForm::begin(); ?>
    <?=$form->field($model, "username", [])->textInput(['options'=>[], 'readonly' => 'true']) ?>
    <?=$form->field($model, "email", [])->textInput(['options'=>[], 'readonly' => 'true']) ?>
    <?=$form->field($model, "token", [])->textInput(['options'=>[]]) ?>
    <?=$form->field($model, "sign_key", [])->textInput(['options'=>[]]) ?>
    <?= $form->field($model, 'status')->dropDownList($model::getStatus()) ?>
    <?=$form->field($model, "phone", [])->textInput(['options'=>[]]) ?>
    <?=$form->field($model, "user_type", [])->dropDownList($model::getUserType()) ?>
    <?=$form->field($model, "company", [])->textInput(['options'=>[]]) ?>
    <?=$form->field($model, "newPassword", [])->textInput(['options'=>[]]) ?>
    <?=$form->field($model, "reNewPassword", [])->textInput(['options'=>[]]) ?>
    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>
    <?php ActiveForm::end(); ?>
</div>
